package com.forlgb.powercloud.authorization.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.forlgb.powercloud.authorization.entity.SysPermission;
import com.forlgb.powercloud.authorization.entity.SysRolePermission;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lyk
 * @since 2021-05-28
 */
public interface SysPermissionMapper extends BaseMapper<SysPermission> {

    @Select("select a.url,b.name as roleName from sys_permission a, sys_role b, sys_role_permission c where c.permission_id = a.id AND c.role_id = b.id")
    List<SysRolePermission> getSysRolePermissionByRoleId();
}
